home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Cream of the Crop 20
/
Cream of the Crop 20 (Terry Blount) (1996).iso
/
os2
/
animpg14.zip
/
AnimPage.cmd
< prev
next >
Wrap
OS/2 REXX Batch file
|
1996-07-13
|
19KB
|
448 lines
/****************** Animation Page Creator v1.3 ***************/
'@ECHO OFF'
say ' ***************** Animation Page Creator v1.3 ***************'
say ' ************ by Sallie Krebs (skrebs@inwave.com) ********'
/***************** User Variables ************************/
/* IMPORTANT!!!!! If you are running an older version of WebExplorer */
/* which does not support Tables, then set the AnimTables variable to 0 */
AnimTables=1
AnimPath=''
/* AnimPath is the base directory for your animation files. Each
separate animation must be located in its own subdirectory
beneath the base directory. Also, there should be NO directories
other than animations beneath the base directory. If this variable
is blank, then the current directory will be used for the AnimPath
variable. (This assumes that animpage.cmd is run from the base
directory.)
Example: Animpath='c:\inet\animate' */
AnimBackground='bkgdos2.gif' /* Background graphic */
AnimHeader='header.gif' /* Header graphic for top of page */
AnimArc='animarc.gif' /* 'Animation Archive' header graphic- near */
/* the bottom of the page. */
/* Under the Animation Archive graphic will */
/* be a list of up to 5 sites you can link */
/* to. Enter the link and title info below. */
/* Leave blank (ie: '') otherwise. */
AnimArcHRef1='http://www.os2forum.or.at/TeamOS2/English/Special/Animations/'
AnimArcTitle1='OS/2 Information Center - Animations'
AnimArcHRef2='http://www.kuwait.net/~morpheus/web-anim.html'
AnimArcTitle2='WebExplorer Animations Archive'
AnimArcHRef3='http://eev11.e-technik.uni-erlangen.de/animationen.html'
AnimArcTitle3='Animation HomePage'
AnimArcHRef4=''
AnimArcTitle4=''
AnimArcHRef5=''
AnimArcTitle5=''
AnimRdButton='rd_pin.gif' /* Graphic for the AnimArcHRef lines */
AnimDivider='divider.gif' /* Divider graphic. For link to top of page */
AnimLogo='merlin.gif' /* Building for Merlin logo graphic for bottom of page */
AnimLogoHRef='http://www.in.net/~mcdonajp/bfos2m.htm'
AnimRibbon='blueribn.gif' /* Blue Ribbon Logo graphic for bottom of page */
AnimRibbonHRef='http://www.eff.org/blueribbon.html'
/* Blue Ribbon Logo HREF for Blue Ribbon logo */
AnimOnward='everonwd.gif' /* Ever Onward Logo graphic for bottom of page */
AnimOnwardHRef='http://www.aescon.com/innoval/everos2/'
/* the above graphics files should be located in the AnimPath directory.
You can substitute your own graphics for the above by copying your
files to the 'AnimPath' directory. You can then either delete the files
included with AnimPage.cmd and rename your files as above, or edit the
above variables to correspond to the filenames of your graphics. */
/************** End of User Variables ********************/
signal on error name DIE
signal on failure name DIE
signal on halt name DIE
signal on syntax name DIE
/****** required REXXUTIL initialization ******/
rc = RxFuncAdd(SysLoadFuncs, REXXUTIL, SysLoadFuncs)
if rc \= 0 then do
say 'Could not load RexxUtil functions. Exiting.'
exit
end
call SysLoadFuncs
say '********************* NOTE ******************************'
say '*** You must edit the user variables at the start of ***'
say '*** this file before running this program. ***'
say ''
address CMD
/* I wanted to use the following statement, but for some reason it no
longer works?!?!?! Yet another Fixpack 17 bug, er... feature?!?!? */
/* if RxMessageBox('Run AnimPage Now?',, 'YESNO', 'QUERY') = 7 */
/* I'll have to settle for: */
'pause Press Ctrl-C to abort now, or any other key to continue'
say ''
fspec = AnimPath
if fspec == '' then
fspec = directory()||'\'
if (lastpos('\', fspec) \= length(fspec)) then
fspec = fspec||'\'
AnimPath = fspec
/* Make AnimPage.BAK file */
found. = 0
AnimFspec = fspec||AnimPage.htm
rc = SysFileTree(AnimFspec, 'found', 'F')
if found.0 \= 0 then do
ofspec = left(AnimFspec, length(AnimFspec) - 3) || 'BAK'
say 'Copying AnimPage.htm to AnimPage.bak'
'copy 'AnimFspec' 'ofspec
say ''
say 'Deleting old AnimPage.htm'
'del 'AnimFspec
say ''
end
/* find subdirectories */
AnimDirs. = 0
rc = SysFileTree(fspec, 'AnimDirs', 'SDO')
if (rc \= 0)|(AnimDirs.0 == 0) then do
say 'Error reading animation subdirectories. Exiting.'
call SysDropFuncs
exit
end
do x = 1 to AnimDirs.0 /* check each subdirectory: */
AnimFiles. = 0
fspec = AnimDirs.x||'\*.gif'
rc = SysFileTree(fspec, 'AnimFiles', 'FO')
if AnimFiles.0 == 0 then do
fspec = AnimDirs.x||'\*.jpg'
rc = SysFileTree(fspec, 'AnimFiles', 'FO')
if AnimFiles.0 == 0 then do
fspec = AnimDirs.x||'\*.bmp'
rc = SysFileTree(fspec, 'AnimFiles', 'FO')
if AnimFiles.0 == 0 then do
say 'Could not locate any animations. Exiting.'
call SysDropFuncs
exit
end
end
end
end
/* do html header */
call stream AnimFspec, 'c', 'open write'
top = '<IMG src="file:///'||AnimPath||AnimHeader'" alt="[AnimPage]">'
call lineout AnimFspec, '<HTML>'
call lineout AnimFspec, ''
call lineout AnimFspec, '<HEAD>'
call lineout AnimFspec, '<TITLE>WebExplorer Animations</TITLE>'
call lineout AnimFspec, '<body background="file:///'||AnimPath||AnimBackground'">'
call lineout AnimFspec, '</HEAD>'
call lineout AnimFspec, ''
call lineout AnimFspec, '<CENTER>'
call lineout AnimFspec, '<A NAME="top"><B>WebExplorer Animations</B></A>'
call lineout AnimFspec, '</CENTER><P>'
call lineout AnimFspec, '<CENTER>'
call lineout AnimFspec, top
call lineout AnimFspec, '</CENTER><P>'
call lineout AnimFspec, ''
call lineout AnimFspec, '<BODY>'
call lineout AnimFspec, ''
if (AnimTables) then do
call lineout AnimFspec, '<CENTER>'
call lineout AnimFspec, '<TABLE BORDER=3>'
call lineout AnimFspec, '<TR>'
call lineout AnimFspec, '<TH ALIGN="center" VALIGN="middle" NOWRAP>Picture</TH><TH ALIGN="center" VALIGN="middle" NOWRAP>Title</TH><TH ALIGN="center" VALIGN="middle" NOWRAP>Author</TH><TH ALIGN="center" VALIGN="middle" NOWRAP>Size</TH>'
call lineout AnimFspec, '</TR>'
end
else
call lineout AnimFspec, '<ul>'
/* get animation subdirectories info: */
ADir. = 0
do x = 1 to AnimDirs.0
ai = 0
ad = x
ADir.0 = x /* number of animation subdirectories */
ADir.ad.ai = 0 /* init number of anim files in subdir */
AnimFiles. = 0
fspec = AnimDirs.x||'\*.gif'
afext = '.gif' /* anim file extension */
rc = SysFileTree(fspec, 'AnimFiles', 'FO')
if AnimFiles.0 == 0 then do
fspec = AnimDirs.x||'\*.jpg'
afext = '.jpg' /* anim file extension */
rc = SysFileTree(fspec, 'AnimFiles', 'FO')
if AnimFiles.0 == 0 then do
fspec = AnimDirs.x||'\*.bmp'
afext = '.bmp' /* anim file extension */
rc = SysFileTree(fspec, 'AnimFiles', 'FO')
end
end
ADir.ad.ai = AnimFiles.0
do f = 1 to AnimFiles.0
Adir.ad.f = AnimFiles.f
end
ADir.ad.icon = AnimFiles.1 /* icon for main page is first anim file */
attl = AnimFiles.1 /* get just the subdirectory name ... */
apath = filespec('P', attl) /* to use for other variables */
attl = substr(apath, 1, (length(apath) - 1))
epos = lastpos('\', attl) + 1
attl = substr(attl, epos)
ADir.ad.title = attl
fname = attl||'.htm' /* append .htm for loader filename */
ADir.ad.ahtm = fname /* name for individual anim loader files */
ADir.ad.aname = attl /* subdir name only for NAME tag and ...*/
alitxt = attl /* default text for animation list items */
attl = '<TITLE>'||attl||'</TITLE>' /* default title fo